<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/include/taglib.jsp"%>
<html>
<head>
<meta charset="UTF-8">
<title>我要投资-债权转让</title>
<jsp:include page="/include/wchat/head.jsp"></jsp:include>
<link type="text/css" rel="stylesheet" href="/v2/wchat/resrc/css/invest.css">
</head>
<body>
<div id="header"> <a href="/wchatIndex.do" class="backto">返回</a>
  <div class="title-sub">债权转让</div>
</div>
<div id="wrap">
  <div class="table transfer">
    <ul class="items title">
      <li class="c1">名称</li>
      <li class="c2">实际收益</li>
      <li class="c3">期限</li>
      <li class="c4">操作</li>
    </ul>
    <s:if test="#request.debtList.size>0">
		<s:iterator value="#request.debtList" var="debt">
			<ul data-url="/wchatDebtDetail.do?id=${debt.id}" class="items">
	            <li class="c1">
	            	<s:if test="#debt.borrowProduct == 2">
						月利宝<p class="transName">${debt.SN}</p></a>
					</s:if>
					<s:elseif test="#debt.borrowProduct == 3">
						季发宝<p class="transName">${debt.SN}</p></a>
					</s:elseif>
					<s:elseif test="#debt.borrowProduct == 4">
						稳盈宝<p class="transName">${debt.SN}</p></a>
					</s:elseif>
	             <p>
	             <span class="account">￥${debt.debtSum }</span>
	             <i class="icon-zhuan"></i>
	             </p>
	            </li>
	            <li class="c2"><s:property value="#debt.realAnnualRate" default="0" />%</li>
	            <li class="c3">${debt.deadline - debt.hasDeadline }
						<s:if test="%{#debt.isDayThe ==1}">个月</s:if>
						<s:else>天</s:else>
				</li>
	            <li class="c4">
               	<s:if test="#debt.debtStatus == 2">
	                <a onclick="investCredit(${debt.id})" class="gbtn">购买</a>
				</s:if>
				<s:elseif test="#debt.debtStatus == 3">
	                <span class="gbtn gbtn-disabled">已转让</span>
				</s:elseif>
	            </li>
	         </ul>
		</s:iterator>
		<div class="page">
			<s:if test="#request.currentPage  <= 1">
				<span class="disabled pre"> 上一页 </span>
			</s:if>
			<s:else>
				<a href="javascript:;" onclick="return $pager.go(${currentPage-1});" class="pre">上一页 </a>
			</s:else>
			<s:if test="#request.currentPage == #request.totalPageNum">
		   		<span class="disabled next"> 下一页 </span>
			</s:if>
			<s:else>
			   	<a href="javascript:;" onclick="return $pager.go(${currentPage + 1});" class="next"> 下一页 </a>
			</s:else>
		</div>
	</s:if>
<form id="pageSearchForm" name="pageSearchForm" action="/wchatDebtList.do" method="post"></form>
 </div>
<script type="text/javascript">
	//分页js形式带参请求
	var $pager = (function(manager) {
	 			var _params = {};
	 			manager.go = function(page) {
	     			if(page > 5){
	         			page = 5;
	     			}
	     			var htmlStr = '<input type="hidden" name="page" value="' + page + '" />';
	     			for (var key in _params) {
	         			htmlStr += '<input type="hidden" name="' + key + '" value="' + _params[key] + '" />';
	     			}
	     			$("#pageSearchForm").html(htmlStr).submit();
	 			};
	 			manager.create = function(params) {
	     			_params = params;
	 			};
	 			return manager;
	} ($pager || {}));
</script>
</div>



<jsp:include page="/include/wchat/footer.jsp"></jsp:include>

<script type="text/javascript">
  function investDebt(loanInvestorId){
	  window.location.href="/loanDebtDetailInvest.do?" + "id="+ loanInvestorId;
  }
</script>
</body>
</html>